

#ifndef USER_MATH_H
#define USER_MATH_H

#define u8_to_u16(u8h, u8l) (u8h * 0x100 + u8l)
#define u16_to_u8h(u16) (u16 >> 8)
#define u16_to_u8l(u16) (u16 & 0xff)
#define u16_to_u32(u16h, u16l) ((uint32_t)(u16h * 0x10000 + u16l))
#define u32_to_u16h(u32) (u32 >> 16)
#define u32_to_u16l(u32) (u32 & 0xffff)
#define u8_to_u32(u8lh, u8ll, u8hh, u8hl)                                      \
    (u8hh * 0x1000000 + u8hl * 0x10000 + u8lh * 0x100 + u8ll)
#define u32_to_u8hh(u32) (u32 >> 24)
#define u32_to_u8hl(u32) ((u32 >> 16) & 0xff)
#define u32_to_u8lh(u32) ((u32 >> 8) & 0xff)
#define u32_to_u8ll(u32) (u32 & 0xff)

#define M_PI_F 3.1415927f
#define M_2PI_F 6.2831853f
#define M_4PI_F 12.56637f

#endif // USER_MATH_H
